package com.k;

import com.k.base.jdk.enums.GenderTypeEnum;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.ZoneId;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

public class Test {
    public static final String PATTERN_YM = "yyyy-MM";
    public static final String PATTERN_YMD = "yyyy-MM-dd";
    public static final String PATTERN_YMDH = "yyyy-MM-dd HH";
    public static final String PATTERN_YMDHM = "yyyy-MM-dd HH:mm";
    public static final String PATTERN_YMDHMS = "yyyy-MM-dd HH:mm:ss";
    public static final String PATTERN_YMDHMSS = "yyyy-MM-dd HH:mm:ss.SSS";

    //  zone UTC
    public static final String PATTERN_UTC_S = "yyyy-MM-dd'T'HH:mm:ss'Z'";
    public static final String PATTERN_UTC_MS = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";

    // zone
    public static final String PATTERN_ZONE_S = "yyyy-MM-dd'T'HH:mm:ssZ";
    public static final String PATTERN_ZONE_MS = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";

    public static void main(String[] args) {
        AtomicInteger late = new AtomicInteger();
        System.out.println(late.get());
        Map map = GenderTypeEnum.selectMap;
        System.out.println(map);


        String appCode ="ads,vcs";
        List<String> appCodes = Arrays.stream(appCode.split(",")).collect(Collectors.toList());
        System.out.println(appCodes);


        String sendTime = "2024-10-15T03:01:20.345Z";
        Date date = new Date();
        try {
            Date d = new SimpleDateFormat(PATTERN_UTC_MS).parse(sendTime);
            System.out.println(d);
            System.out.println(date);

            SimpleDateFormat sdf = new SimpleDateFormat(PATTERN_UTC_MS);
            sdf.setTimeZone(TimeZone.getTimeZone(ZoneId.of("UTC")));
            String sss = sdf.format(date);
            System.out.println(sss);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
